package com.liujun.spring4.demo.aop.aopproblem.base;

import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;

/**
 * 指定的切面增强
 *
 * @author liujun
 * @version 0.0.1
 * @date 2018/09/22
 */
public class GreetingBeforeAdvice implements MethodBeforeAdvice {

  @Override
  public void before(Method method, Object[] args, Object target) throws Throwable {
    System.out.println(target.getClass().getName() + "." + method.getName());
    String clientName = String.valueOf(args[0]);
    System.out.println("How are you ! Mr." + clientName + ".");
  }
}
